<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>车辆编辑</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
  
    <link rel="stylesheet" href="../plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="../plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="../css/style.css">
	<script src="../plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="../plugins/bootstrap/js/bootstrap.min.js"></script>
    
    <!-- 富文本编辑器 -->
	<link rel="stylesheet" href="../plugins/kindeditor/themes/default/default.css" />
	<script charset="utf-8" src="../plugins/kindeditor/kindeditor-min.js"></script>
	<script charset="utf-8" src="../plugins/kindeditor/lang/zh_CN.js"></script>

	<script src="/plugins/angularjs/angular.min.js"></script>

	<!--引入不带有分页的模块-->
	<script src="/js/base.js"></script>

	<script src="/js/service/carService.js"></script>

	<script src="/js/service/uploadService.js"></script>

	<script src="/js/controller/baseController.js"></script>

	<script src="/js/controller/carController.js"></script>
      
    
    
</head>

<body class="hold-transition skin-red sidebar-mini" ng-app="rentcar" ng-controller="carController">

            <!-- 正文区域 -->
            <section class="content">

                <div class="box-body">

                    <!--tab页-->
                    <div class="nav-tabs-custom">
                        <!--tab头-->
                        <ul class="nav nav-tabs">                       		
                            <li class="active">
                                <a href="#home" data-toggle="tab">车辆基本信息</a>
                            </li>   
                            <li >
                                <a href="#pic_upload" data-toggle="tab">车辆图片</a>
                            </li>    
                            <li >
                                <a href="#customAttribute" data-toggle="tab">扩展属性</a>                                                        
                            </li>
                        </ul>
                        <!--tab头/-->
						
                        <!--tab内容-->
                        <div class="tab-content">

                            <!--表单内容-->
                            <div class="tab-pane active" id="home">
                                <div class="row data-type">
		                           <div class="col-md-2 title">车牌号</div>
		                           <div class="col-md-10 data">
		                               <input type="text" class="form-control"  ng-model="entity.car.plateNumber"  placeholder="车牌号" value="">
		                           </div>

									<div class="col-md-2 title">品牌</div>
									<div class="col-md-10 data">
										<input type="text" class="form-control"  ng-model="entity.car.brand"  placeholder="品牌" value="">
									</div>

									<div class="col-md-2 title">具体型号</div>
									<div class="col-md-10 data">
										<input type="text" class="form-control"  ng-model="entity.car.type"  placeholder="具体型号" value="">
									</div>

									<div class="col-md-2 title">颜色</div>
									<div class="col-md-10 data">
										<input type="text" class="form-control"  ng-model="entity.car.color"  placeholder="颜色" value="">
									</div>

								   <div class="col-md-2 title">车架号</div>
		                           <div class="col-md-10 data">
		                               <input type="text" class="form-control" ng-model="entity.car.frameId"  placeholder="车架号" value="">
		                           </div>
		                           
		                           <div class="col-md-2 title">租金</div>
		                           <div class="col-md-10 data">
		                           	   <div class="input-group">
			                          	   <span class="input-group-addon">¥</span>
			                               <input type="text" class="form-control" ng-model="entity.car.rentFee" placeholder="租金" value="">
		                           	   </div>
		                           </div>

									<div class="col-md-2 title">押金</div>
									<div class="col-md-10 data">
										<div class="input-group">
											<span class="input-group-addon">¥</span>
											<input type="text" class="form-control" ng-model="entity.car.deposit" placeholder="押金" value="">
										</div>
									</div>

									<div class="col-md-2 title">最大油量</div>
									<div class="col-md-10 data">
										<input type="text" class="form-control" ng-model="entity.car.capacity"  placeholder="最大油量" value="">
									</div>

									<div class="col-md-2 title">当前油量</div>
									<div class="col-md-10 data">
										<input type="text" class="form-control" ng-model="entity.car.initFuel"  placeholder="当前油量" value="">
									</div>


		                           <div class="col-md-2 title editer">车辆描述</div>
                                   <div class="col-md-10 data editer">
									   <input type="hidden" ng-model="entity.car.desc">
                                       <textarea name="content" style="width:800px;height:400px;visibility:hidden;" ></textarea>
                                   </div>
                                </div>
                            </div>
                            
                            <!--图片上传-->
                            <div class="tab-pane" id="pic_upload">
                                <div class="row data-type">                                  
								 <!-- 颜色图片 -->
								 <div class="btn-group">
					                 <button type="button" class="btn btn-default" title="新建" data-target="#uploadModal" ng-click="image_entity={}" data-toggle="modal"  ><i class="fa fa-file-o"></i> 新建</button>
					             </div>
								 
								 <table class="table table-bordered table-striped table-hover dataTable">
					                    <thead>
					                        <tr>
											    <th class="sorting">图片说明</th>
											    <th class="sorting">图片</th>
												<th class="sorting">操作</th>
							            </thead>
					                    <tbody>
					                      <tr ng-repeat="image in entity.imageList">
									            <td>
									            	{{image.title}}
									            </td>
									            <td>
									           		<img alt="" src="{{image.path}}" width="100px" height="100px">
									            </td>
												 <td> <button type="button" class="btn btn-default" title="删除" ng-click="remove_image_entity($index)"><i class="fa fa-trash-o"></i> 删除</button></td>
					                      </tr>
					                    </tbody>
								 </table> 
								  
                                </div>
                            </div>
                           
                           
                            <!--扩展属性-->
                            <div class="tab-pane" id="customAttribute">
                                <div class="row data-type">
									<div class="btn-group">
										<button type="button" class="btn btn-default" ng-click="addTableRow()" title="新建" ><i class="fa fa-file-o"></i> 新建</button>
									</div>
	                                <div class="row" ng-repeat="carOption in entity.caroptionList">
		                                <div class="col-md-2 title">扩展属性</div>
				                        <div class="col-md-4 data">
				                              <input class="form-control" ng-model="carOption.optionName" placeholder="属性名称">
				                        </div>
										<div class="col-md-4 data">
											<input class="form-control" ng-model="carOption.optionValue" placeholder="属性的值">
										</div>
										<div class="col-md-2">
											<button class="btn btn-default" ng-click="deleteTableRow()">删除</button>
										</div>
	                                </div>       

                                </div>
                            </div>
                        </div>
                        <!--tab内容/-->
						<!--表单内容/-->
							 
                    </div>

                   </div>
                  <div class="btn-toolbar list-toolbar">
				      <button class="btn btn-primary" ng-click="save()" ><i class="fa fa-save"></i>保存</button>
				      <button class="btn btn-default" >返回列表</button>
				  </div>
			
            </section>
            
            
<!-- 上传窗口 -->
<div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog" >
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			<h3 id="myModalLabel">上传商品图片</h3>
		</div>
		<div class="modal-body">							
			
			<table class="table table-bordered table-striped">
		      	<tr>
		      		<td>说明</td>
		      		<td><input ng-model="image_entity.title" class="form-control" placeholder="说明" >  </td>
		      	</tr>			    
		      	<tr>
		      		<td>商品图片</td>
		      		<td>
						<table>
							<tr>
								<td>
								<input type="file" id="file" />				                
					                <button class="btn btn-primary" type="button" ng-click="uploadFile()" >
				                   		上传
					                </button>	
					            </td>
								<td>
									<img  src="{{image_entity.path}}" width="200px" height="200px">
								</td>
							</tr>						
						</table>
		      		</td>
		      	</tr>		      	
			 </table>
		</div>
		<div class="modal-footer">						
			<button class="btn btn-success"  data-dismiss="modal" ng-click="add_image_entity()" aria-hidden="true">保存</button>
			<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
		</div>
	  </div>
	</div>
</div>

            
            <!-- 正文区域 /-->
<script type="text/javascript">

	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
			allowFileManager : true
		});
	});

</script>
       
</body>

</html>